msp430mcu_version := 20120406

origin_src_tarball := msp430mcu-$(msp430mcu_version).tar.bz2
origin_src_dir := msp430mcu-$(msp430mcu_version)
repo := http://sourceforge.net/projects/mspgcc/files/msp430mcu/$(origin_src_tarball)

all: init
# DO NOTHING

.PHONY:init
init: sources
sources: $(origin_src_tarball)
	@echo extracting files...
	@tar xmf $(origin_src_tarball) && \
	mv $(origin_src_dir) sources
	@echo extract files done

$(origin_src_tarball):
	@wget -c -O $(origin_src_tarball) $(repo);

patch:
# NOT NEEDED
unpatch:
# DO NOTHING

clean:
# DO NOTHING

distclean: clean
	@$(RM) -r sources

distdistclean: distclean
	@$(RM) $(origin_src_tarball)

install:
	@cd sources && MSP430MCU_ROOT=`pwd` ./scripts/install.sh $(INSTALL_DIR)

uninstall:
	#TODO: msp430mcu uninstall
